load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
load("//def:ts.bzl", "jasmine_node_test", "ts_library")

jasmine_node_test(
    name = "script_test",
    srcs = ["script_test.js"],
    data = ["js-srcs"],
    deps = [
        "@npm//jasmine",
    ],
)

filegroup(
    name = "js-srcs",
    srcs = glob(["*.js"]),
)

filegroup(
    name = "package-srcs",
    srcs = glob(["**"]),
    tags = ["automanaged"],
    visibility = ["//visibility:private"],
)

filegroup(
    name = "all-srcs",
    srcs = [
        ":package-srcs",
        "//triage/berghelroach:all-srcs",
        "//triage/summarize:all-srcs",
        "//triage/utils:all-srcs",
    ],
    tags = ["automanaged"],
    visibility = ["//visibility:public"],
)

go_library(
    name = "go_default_library",
    srcs = ["main.go"],
    importpath = "k8s.io/test-infra/triage",
    visibility = ["//visibility:private"],
    deps = ["//triage/summarize:go_default_library"],
)

go_binary(
    name = "triage",
    embed = [":go_default_library"],
    visibility = ["//visibility:public"],
)
